package com.tz.farmer.controller;


import com.smartPark.msframe.result.ResultEx;
import com.tz.farmer.util.ResultExM;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;


@Api(tags = "分类接口")
@Slf4j
@RestController
@RequestMapping("/classify")
public class ClassifyController {

    @GetMapping("list")
    @ApiOperation("产品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "", value = "", dataType = "", defaultValue = "", required = false)
    })
    public ResultEx getClassifyList(){
        /*Map<String, String> map = ClassifyEnum.map;
        Set<Map.Entry<String, String>> entrySet = map.entrySet();
        String str="name";
        int i=0;
        for (Map.Entry<String, String> entry : entrySet) {
            i++;
            System.out.println(str+i + ":" + entry.getValue());
        }*/


        List list =new ArrayList<>();
        list.add("豆制品");
        list.add("果品");
        list.add("食用菌");
        list.add("调味品");
        list.add("乳品及其乳制品");
        list.add("水产品");
        list.add("粮食及其制品");
        list.add("茶类");
        list.add("肉禽蛋");
        list.add("蔬菜");

        return  ResultExM.builder().makeSuccessResult(list);
    }


    @GetMapping("detection")
    @ApiOperation("检测分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "", value = "", dataType = "", defaultValue = "", required = false)
    })
    public ResultEx getClassify(){
        List list =new ArrayList<>();
        list.add("当前商户");
        list.add("当前商品");

        return  ResultExM.builder().makeSuccessResult(list);
    }



}
